package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_match_prize;

//DAO
public interface U_match_prizeMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_MATCH_PRIZE  WHERE PRIZE_ID = #{prize_id}")
	public ApiU_match_prize findU_match_prizeById(Integer prize_id);

	// 查看数据集
	@Select("SELECT * FROM U_match_prize")
	public List<ApiU_match_prize> findU_match_prizes();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_match_prizesByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_MATCH_PRIZE (MATCH_ID, PRIZE_NAME, PRIZE_NUM, PRIZE_MONEY, WINNER_COUNT, PRIZE_PERCENT, REMARK, EXT1, EXT2, EXT3) VALUES (#{match_id}, #{prize_name}, #{prize_num}, #{prize_money}, #{winner_count}, #{prize_percent}, #{remark}, #{ext1}, #{ext2}, #{ext3})")
	@Options(useGeneratedKeys = true, keyProperty = "prize_id")
	public int insertU_match_prize(ApiU_match_prize u_match_prize);

	// 修改
	@Update("UPDATE U_MATCH_PRIZE SET MATCH_ID = #{match_id}, PRIZE_NAME = #{prize_name}, PRIZE_NUM = #{prize_num}, PRIZE_MONEY = #{prize_money}, WINNER_COUNT = #{winner_count}, PRIZE_PERCENT = #{prize_percent}, REMARK = #{remark}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3} WHERE PRIZE_ID = #{prize_id}")
	public int updateU_match_prize(ApiU_match_prize u_match_prize);

	// 删除
	@Delete("DELETE FROM U_MATCH_PRIZE  WHERE PRIZE_ID = #{prize_id}")
	public int deleteU_match_prize(Integer prize_id);

	// Foreign keys revelant

	// region Indexs revelant

}
